


from django.contrib.auth.models import Permission
from rest_framework.viewsets import ModelViewSet
from meiduo_admin.sysmange import permission_serializer
from meiduo_admin.my_paginate import MyPageNumberPagination

from rest_framework.generics import ListAPIView
from django.contrib.contenttypes.models import ContentType


#1,permission管理
class PermissionViewSet(ModelViewSet):
    pagination_class = MyPageNumberPagination
    serializer_class = permission_serializer.PermissionSerializer
    queryset = Permission.objects.order_by("id").all()

#2,permission content_types, 获取权限类型
class PermissionContentTypeView(ListAPIView):
    serializer_class = permission_serializer.PermissionContentTypeSerializer
    queryset = ContentType.objects.all()